#ifndef DATA_SET_GET_SERVICE_HPP
#define DATA_SET_GET_SERVICE_HPP
/* RTOS */
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
/* 接口库 */
#include "L2DataSet.hpp"

class DataAccessor {
public:
    virtual bool init(void);
    virtual bool deinit(void);

    virtual bool add(const char *label,bool value);
    virtual bool add(const char *label,double value);
    virtual bool add(const char *label,const char *value);
    virtual bool remove(const char *label);
    virtual bool set(const char *label,bool value);
    virtual bool set(const char *label,double value);
    virtual bool set(const char *label,const char *value);
    virtual bool getBoolean(const char *label);
    virtual double getNumber(const char *label);
    virtual const char *getString(const char *label);
    
    static DataAccessor * getInstance();

private:
    SemaphoreHandle_t data_set_get_semaphore = NULL;
    SemaphoreHandle_t data_set_get_speed_mutex = NULL;
    DataSet dataset;

};



#endif
